@extends('admin/layout.app')

@section('title', '职位管理')

@section('content')
    @if($role_list)
        <table class="list_tab">
            <thead>
            <tr>
                <th>ID</th>
                <th>职务名称</th>
                <th>职务描述</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            @foreach($role_list as $item)
                <tr>
                    <td>{{ $item['id'] }}</td>
                    <td>{{ $item['name'] }}</td>
                    <td>{{ $item['remark'] }}</td>
                    <td>
                        <span class="{{$item['status'] == 1 ? 'status-normal' : 'disable' }}">{{$item['status'] == 1 ? '正常' : '禁用' }}</span>
                    </td>
                    <td>
                        @if( $item['id'] != env('ADMINISTRATOR_ROLE_ID') || $current_user['is_admin'])
                            <a href="/admin/role_menu/{{ $item['id'] }}" class="text-primary" title="设置职位权限"
                               data-toggle="tooltip"><i class="option-icon" ></i></a>
                            <a href="/admin/role/{{ $item['id'] }}/edit" class="text-info" title="编辑职位"
                               data-toggle="tooltip"><i class="edit-icon" ></i></a>
                            <a href="" class="show-dialog  text-warning"  data-id="{{$item['id']}}" data-type="role" title="删除" data-toggle="tooltip"><i class="remove-icon" ></i></a>
                        @endif
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>
        {!! $role_list->render() !!}
    @endif
@endsection
